package com.jwell.IDcard.reader;

import com.jwell.IDcard.reader.api.IDCardInfo;
import com.jwell.IDcard.reader.api.Invoker;
import com.jwell.IDcard.reader.api.PhotoReader;

import java.util.Scanner;

/**
 * @author 唐旭
 * @version 1.0.0
 * @FileName:
 * @Company: 成都积微物联电子商务有限公司
 * @Date 2017/12/28
 * @remark:
 */
public class Main {
    public static void main(String[] args) {
        PhotoReader reader = new PhotoReader();
        reader.addInvoker(new Invoker() {
            @Override
            public void invoke(IDCardInfo info) {
                System.out.println("获取到的信息1为:" + info);
            }
        });
        reader.addInvoker(new Invoker() {
            @Override
            public void invoke(IDCardInfo info) {
                System.out.println("获取到的信息2为:" + info);
            }
        });
        reader.start();

        //输入n结束程序
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        if ("n".equalsIgnoreCase(s)) {
            reader.stopReader();
        }
    }
}
